package com.project.bookstore.stock.controller;

import com.project.bookstore.book.service.BookService;
import com.project.bookstore.common.CommonResult;
import com.project.bookstore.stock.pojo.StockAddNewVO;
import com.project.bookstore.stock.service.StockService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "库存模块")
@RestController
public class StockController {
    @Autowired
    private StockService stockService;

    @ApiOperation("入库")
    @PostMapping("/admin/stock")
    public CommonResult<Void> insert(@RequestBody StockAddNewVO stockAddNewVO) {
        Long id = stockService.addNew(stockAddNewVO);
        return CommonResult.ok();
    }
}
